{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=3078
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	n,ans,prev,cur,sp,sc,cc:int64;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
prev:=n;
read(n);
cur:=n;
ans:=1;
sp:=cur-prev;
cc:=1;
while n<>0 do begin
	sc:=cur-prev;
	if sp*sc>0 then inc(cc) else
	if sp*sc=0 then cc:=1 else cc:=2;
	ans:=max(ans,cc);
	sp:=sc;
	prev:=cur;
	read(n);
	cur:=n;
end;
write(ans);
end.